function init() {
	_initHeader();
	$("#geolocation").click(clickedGeolocation);
}

function clickedGeolocation() {
	commonProgress("Getting geolocation..", true, "showProgressDialogCancelCallback", "white");
	geolocation.getLocation(successCallback, errorCallback);
}

function showProgressDialogCancelCallback() {
	platformUIComponent.dismissProgressDialog();
}

function successCallback(position) {
	platformUIComponent.dismissProgressDialog();
	$("#logitude").text(position.coords.longitude);
	$("#latitude").text(position.coords.latitude);
}

function errorCallback(error) {
	platformUIComponent.dismissProgressDialog();
	switch(error.code) {
		case error.PERMISSION_DENIED :
			alert("User denied the request for Geolocation.");
			
		break;
		
		case error.POSITION_UNAVAILABLE :
			alert("Location information is unavailable.");
			
		break;
		
		case error.TIMEOUT :
			alert("The request to get user location timed out.");
			
		break;
		
		case error.UNKNOWN_ERROR :
			alert("An unknown error occurred.");
			
		break;
		
		case error.NETWORK_UNAVAILABLE :
			alert("Network is not available.");
			
		break;
		
		case error.DEVICE_NOT_SUPPORTED :
			alert("Device is not support geolocation.");
			
		break;
	}
}
